package fr.charlott.batch.writer;

import java.util.List;

import org.springframework.batch.item.ItemWriter;
import org.springframework.beans.factory.annotation.Autowired;

import fr.charlott.core.repository.model.Cliente;
import fr.charlott.core.service.ClienteService;

public class ClienteWriter implements ItemWriter<Cliente>{

	@Autowired
	private ClienteService clienteService;
	

	@Override
	public void write(List<? extends Cliente> items) throws Exception {
		for (Cliente cliente : items) {
			clienteService.ajouterCliente(cliente);
		}
	}

	public void setClienteService(ClienteService clienteService) {
		this.clienteService = clienteService;
	}
}
